#include<bits/stdc++.h>
using namespace std;
int n,m,t;
vector<int>a;
int c[114514];
int main()
{
	freopen("arena.in","r",stdin);
	freopen("arena.out","w",stdout);
	scanf("%d%d",&n,&m);
	for(int i=1;i<=n;i++)
	{
		int x;
		scanf("%d",&x);
		a.push_back(x);
	}
	for(int i=1;i<=m;i++)
		scanf("%d",&c[i]);
	scanf("%d",&t);
	while(t--)
	{
		printf("0\n");
	}
	return 0;
}
